define(['lib/ammo'], function(Ammo) {

function AmmoPhysicsPass() {
  var collisionConfiguration = new Ammo.btDefaultCollisionConfiguration();
  var dispatcher = new Ammo.btCollisionDispatcher(collisionConfiguration);
  var overlappingPairCache = new Ammo.btDbvtBroadphase();
  var solver = new Ammo.btSequentialImpulseConstraintSolver();
  this.dynamicsWorld = new Ammo.btDiscreteDynamicsWorld(
    dispatcher, overlappingPairCache, solver, collisionConfiguration);
  this.dynamicsWorld.setGravity(new Ammo.btVector3(0, -10, 0));
};

AmmoPhysicsPass.prototype.execute = function(timeDeltaMillis) {
  this.dynamicsWorld.stepSimulation(timeDeltaMillis / 1000, 10);
};

return AmmoPhysicsPass;

});
